package cn.iocoder.yudao.module.cdk.dal.mysql.cdk;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.cdk.controller.admin.cdk.vo.CdkPageReqVO;
import cn.iocoder.yudao.module.cdk.dal.dataobject.cdk.CdkDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * cdk Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface CdkMapper extends BaseMapperX<CdkDO> {

    default PageResult<CdkDO> selectPage(CdkPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CdkDO>()
                .eqIfPresent(CdkDO::getCdk, reqVO.getCdk())
                .eqIfPresent(CdkDO::getEndable, reqVO.getEndable())
                .betweenIfPresent(CdkDO::getOuttime, reqVO.getOuttime())
                .orderByDesc(CdkDO::getId));
    }

}